<?php
namespace app\serveradv\validate;

use \app\manage\validate\BaseValidate;
/**
 * @Author: 蒋哲
 * @Date:   2017-05-25 11:49:42
 * @Last Modified by:   Marte
 * @Last Modified time: 2017-05-27 10:46:23
 */
class AdvClassify extends BaseValidate
{
    protected $rule = [
        'name'   => ['require'],
        'id'     => ['require', 'number', 'gt'=>0],
        'pid'    => ['require', 'number', 'egt'=>0],
        'status' => ['in'=>['-1','0','1']],
        'app_id' => ['require'],
        'action' => ['require'],
    ];

    protected $message = [
        'name.require'   => '请填写广告位分类名称',
        'id.require'     => '请填写广告位分类id',
        'id.number'      => '广告位分类id必须为整数',
        'id.gt'          => '广告位分类id必须大于0',
        'pid.require'    => '请填写广告位分类pid',
        'pid.number'     => '广告位分类pid必须为整数',
        'pid.gt'         => '广告位分类pid必须大于0',
        'status.in'      => 'status值为-1、0或1',
    ];

    protected $scene = [
        'add'        => ['name', 'app_id', 'pid', 'action'],
        'edit'       => ['id', 'action'],
        'enable'     => ['id'],
        'pid'        => ['pid','app_id'],
        'status'     => ['status'],
        'app_id'     => ['app_id'],
    ];
}